﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Base;
using nspKnow;
using SqlOperate;

public partial class Know_KnowAccept : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string AnswerID = "", ProblemsID = "", str = "";
        if (Request.Form["AnswerID"] != "" && Request.Form["AnswerID"] != null)
        {
            AnswerID = Request.Form["AnswerID"].ToString();
        }
        if (Request.Form["ProblemsID"] != "" && Request.Form["ProblemsID"] != null)
        {
            ProblemsID = Request.Form["ProblemsID"].ToString();
            str = "ID=" + ProblemsID;
        }
        if (AnswerID != "" && ProblemsID != "")
        {
            string sql = "UPDATE W_KnowProblems SET State=1 WHERE ID=" + ProblemsID;
            string sql2 = "UPDATE W_KnowAnswer SET State=1 WHERE ID=" + AnswerID;
            string[] strSql ={ sql, sql2 };
            for (int i = 0; i < strSql.Length; i++)
            {
                SqlHelper.ExecuteNonQuery(strSql[i]);
            }
            Response.Write("<script>alert('采纳成功！');location='Detail.aspx?" + str + "'</script>");
        }
    }
}
